<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Getting Started</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="ODTONE 0.3">
<link rel="up" href="../miis_index.html" title="MIIS Server">
<link rel="prev" href="../miis_index.html" title="MIIS Server">
<link rel="next" href="../link_sap_index.html" title="Link SAP">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="'ODTONE - Open Dot Twenty One'" width="100" height="100" src="../../.././images/logo.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../miis_index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../miis_index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../link_sap_index.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
<div class="section" title="Getting Started">
<div class="titlepage"><div><div><h4 class="title">
<a name="odtone.app.miis_index.miis_getStart"></a><a class="link" href="miis_getStart.html" title="Getting Started"> Getting Started</a>
</h4></div></div></div>
<div class="section" title="Detailed Description">
<div class="titlepage"><div><div><h5 class="title">
<a name="odtone.app.miis_index.miis_getStart.detailed_description"></a><a class="link" href="miis_getStart.html#odtone.app.miis_index.miis_getStart.detailed_description" title="Detailed Description">Detailed
          Description</a>
</h5></div></div></div>
<p>
            This MIIS Server example uses the Redland RDF libraries for parsing and
            querying a sqlite database (other databases can be used too). Check the
            <a href="http://librdf.org/docs/" target="_top">Redland documentation</a> for
            more details.
          </p>
<p>
            Although an example database is provided (example-database), it is possible
            to use other database previously created.
          </p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">base-schema.xml</span></dt>
<dd><p>
                is the base schema provided in the standard
              </p></dd>
<dt><span class="term">example-data.ttl</span></dt>
<dd><p>
                is a Turtle file with some random data for testing queries. Check
                <a href="http://www.w3.org/TeamSubmission/turtle" target="_top">http://www.w3.org/TeamSubmission/turtle</a>
                for more details. The example is in this format because it is more
                clearer than the equivalent XML
              </p></dd>
<dt><span class="term">example-database</span></dt>
<dd><p>
                is a sqlite database built from base-schema.xml and example-data.ttl.
              </p></dd>
</dl>
</div>
<p>
            When a MIH_Get_Information.indication is received the message is deserialized
            and the Sparql queries are fetch. The queries are run and the results
            serialized and sent in a MIH_Get_Information.response to the MIHF.
          </p>
</div>
<div class="section" title="Configuration">
<div class="titlepage"><div><div><h5 class="title">
<a name="odtone.app.miis_index.miis_getStart.configuration"></a><a class="link" href="miis_getStart.html#odtone.app.miis_index.miis_getStart.configuration" title="Configuration">Configuration</a>
</h5></div></div></div>
<pre class="programlisting"><span class="identifier">MIH</span> <span class="identifier">Usr</span> <span class="identifier">Configuration</span><span class="special">:</span>
   <span class="special">--</span><span class="identifier">help</span>                                  <span class="identifier">Display</span> <span class="identifier">configuration</span> <span class="identifier">options</span>
   <span class="special">--</span><span class="identifier">conf</span><span class="special">.</span><span class="identifier">port</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="number">1236</span><span class="special">)</span>                 <span class="identifier">Port</span>
   <span class="special">--</span><span class="identifier">conf</span><span class="special">.</span><span class="identifier">file</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="identifier">miis_rdf_server</span><span class="special">.</span><span class="identifier">conf</span><span class="special">)</span> <span class="identifier">Configuration</span> <span class="identifier">File</span>
   <span class="special">--</span><span class="identifier">conf</span><span class="special">.</span><span class="identifier">recv_buff_len</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="number">4096</span><span class="special">)</span>        <span class="identifier">Receive</span> <span class="identifier">Buffer</span> <span class="identifier">Length</span>
   <span class="special">--</span><span class="identifier">mihf</span><span class="special">.</span><span class="identifier">ip</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="number">127.0</span><span class="special">.</span><span class="number">0.1</span><span class="special">)</span>              <span class="identifier">Local</span> <span class="identifier">MIHF</span> <span class="identifier">Ip</span>
   <span class="special">--</span><span class="identifier">mihf</span><span class="special">.</span><span class="identifier">id</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="identifier">local</span><span class="special">-</span><span class="identifier">mihf</span><span class="special">)</span>             <span class="identifier">Local</span> <span class="identifier">MIHF</span> <span class="identifier">Id</span>
   <span class="special">--</span><span class="identifier">user</span><span class="special">.</span><span class="identifier">id</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="identifier">miis</span><span class="special">)</span>                   <span class="identifier">MIIS</span> <span class="identifier">Server</span> <span class="identifier">ID</span>
   <span class="special">--</span><span class="identifier">mihf</span><span class="special">.</span><span class="identifier">local_port</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="number">1025</span><span class="special">)</span>           <span class="identifier">MIHF</span> <span class="identifier">Local</span> <span class="identifier">Communications</span> <span class="identifier">Port</span>
   <span class="special">--</span><span class="identifier">dest</span> <span class="identifier">arg</span>                              <span class="identifier">MIH</span> <span class="identifier">message</span> <span class="identifier">destination</span> <span class="identifier">of</span> <span class="identifier">MIIS</span> <span class="identifier">server</span>
   <span class="special">--</span><span class="identifier">database</span> <span class="identifier">arg</span> <span class="special">(=</span><span class="identifier">database</span><span class="special">)</span>              <span class="special">/</span><span class="identifier">path</span><span class="special">/</span><span class="identifier">to</span> <span class="identifier">MIIS</span> <span class="identifier">server</span> <span class="identifier">sqlite</span> <span class="identifier">database</span>
</pre>
<p>
            MIIS Server can be configured either through a configuration file or
            passing directly, in command line, the configuration options.
          </p>
<p>
            The path to the database can be passed with the --database option.
          </p>
<p>
            <span class="bold"><strong>How to build a database:</strong></span>
          </p>
<p>
            1) Create a sqlite database and parse a base schema which is in rdfxml
            syntax:
          </p>
<pre class="programlisting"><span class="identifier">rdfproc</span> <span class="special">-</span><span class="identifier">s</span> <span class="identifier">sqlite</span> <span class="identifier">database_name</span> <span class="identifier">parse</span> <span class="identifier">file</span><span class="special">:/</span><span class="identifier">path</span><span class="special">/</span><span class="identifier">to</span><span class="special">/</span><span class="identifier">schema</span><span class="special">.</span><span class="identifier">xml</span>
</pre>
<p>
            2) Parse and add some data, in Turtle format, to the database:
          </p>
<pre class="programlisting"><span class="identifier">rdfproc</span> <span class="special">-</span><span class="identifier">s</span> <span class="identifier">sqlite</span> <span class="identifier">database_name</span> <span class="identifier">parse</span> <span class="identifier">file</span><span class="special">:/</span><span class="identifier">path</span><span class="special">/</span><span class="identifier">to</span><span class="special">/</span><span class="identifier">data</span><span class="special">.</span><span class="identifier">xml</span> <span class="identifier">turtle</span>
</pre>
</div>
<div class="section" title="Extending">
<div class="titlepage"><div><div><h5 class="title">
<a name="odtone.app.miis_index.miis_getStart.extending"></a><a class="link" href="miis_getStart.html#odtone.app.miis_index.miis_getStart.extending" title="Extending">Extending</a>
</h5></div></div></div>
<p>
            It is possible to do several extensions to MIIS Server in a simple and
            fast way.
          </p>
<p>
            For example, in recv_handler can be added specific behaviour for an incoming
            message after MIIS Server sent MIH GET Information Response. So, MIIS
            Server can make its own decisions about the actions that must be initiated.
          </p>
<p>
            
</p>
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">void</span> <span class="identifier">recv_handler</span><span class="special">(</span><span class="identifier">odtone</span><span class="special">::</span><span class="identifier">mih</span><span class="special">::</span><span class="identifier">message</span> <span class="special">&amp;</span><span class="identifier">m</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="identifier">e</span><span class="special">)</span>
<span class="special">{</span>
	<span class="comment">// ...
</span><span class="special">}</span>
</pre>
<p>
          </p>
</div>
<div class="section" title="Running">
<div class="titlepage"><div><div><h5 class="title">
<a name="odtone.app.miis_index.miis_getStart.running"></a><a class="link" href="miis_getStart.html#odtone.app.miis_index.miis_getStart.running" title="Running">Running</a>
</h5></div></div></div>
<p>
            There is no running recommendation for MIIS Server. It can be run after
            or before the local MIHF.
          </p>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 -2011 Universidade Aveiro<br>Copyright &#169; 2009 -2011 Instituto de Telecomunica&#231;&#245;es - P&#243;lo Aveiro<p>
        This software is distributed under a license. The full license agreement
        can be found in the LICENSE in this distribution. This software may not be
        copied, modified, sold or distributed other than expressed in the named license
        agreement. This software is distributed without any warranty.
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../miis_index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../miis_index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../link_sap_index.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
